package view;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;

import controller.IGameContext;

public class Canvas extends JPanel {
	/* Required for serializable interface */
	private static final long serialVersionUID = 1L;
	/* Reference to game board for drawing */
	private IGameContext gameContext;
	
	/** Creates a new Canvas */
	public Canvas(IGameContext gameContext) {
		this.gameContext = gameContext;
		//this.setBackground(Color.BLACK);
	}
	
	@Override
	public void paintChildren(Graphics g) {
		g.setColor(Color.RED);
		this.gameContext.draw((Graphics2D)g);
	}
}